package com.naiterui.ehp.bs.emr.entity.mongo;

import java.io.Serializable;
import java.util.Date;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;

/**
 * 病历列表筛选条件
 *
 * @author lichaopi
 * @since 1.0.0
 */
@SuppressWarnings("WeakerAccess")
@Document(collection = "medical_record_screen")
public class MedicalRecordScreen implements Serializable {

    private static final long serialVersionUID = 1244683180684855049L;
    @Id
    @JsonInclude(Include.NON_NULL)
    private String id;
    private Long doctorId;
    private Long patientId;
    private Integer relation;
    private String relationName;
    private Date createAt;// 创建时间
    private String createBy;// 创建人
    private Date changedAt;// 修改时间
    private String changeBy;// 修改人

    public MedicalRecordScreen() {

    }

    private MedicalRecordScreen(Builder builder) {
        this.setId(builder.id);
        this.setDoctorId(builder.doctorId);
        this.setPatientId(builder.patientId);
        this.setRelation(builder.relation);
        this.setRelationName(builder.relationName);
        this.setCreateAt(builder.createAt);
        this.setCreateBy(builder.createBy);
        this.setChangedAt(builder.changedAt);
        this.setChangeBy(builder.changeBy);
    }

    public static Builder newBuilder() {
        return new Builder();
    }

    public Long getDoctorId() {
        return this.doctorId;
    }

    public void setDoctorId(Long doctorId) {
        this.doctorId = doctorId;
    }

    public Long getPatientId() {
        return this.patientId;
    }

    public void setPatientId(Long patientId) {
        this.patientId = patientId;
    }

    public Integer getRelation() {
        return this.relation;
    }

    public void setRelation(Integer relation) {
        this.relation = relation;
    }

    public String getRelationName() {
        return this.relationName;
    }

    public void setRelationName(String relationName) {
        this.relationName = relationName;
    }

    public String getId() {
        return this.id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Date getCreateAt() {
        return this.createAt;
    }

    public void setCreateAt(Date createAt) {
        this.createAt = createAt;
    }

    public String getCreateBy() {
        return this.createBy;
    }

    public void setCreateBy(String createBy) {
        this.createBy = createBy;
    }

    public Date getChangedAt() {
        return this.changedAt;
    }

    public void setChangedAt(Date changedAt) {
        this.changedAt = changedAt;
    }

    public String getChangeBy() {
        return this.changeBy;
    }

    public void setChangeBy(String changeBy) {
        this.changeBy = changeBy;
    }

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }

    public static final class Builder {
        private String id;
        private Long doctorId;
        private Long patientId;
        private Integer relation;
        private String relationName;
        private Date createAt;
        private String createBy;
        private Date changedAt;
        private String changeBy;

        private Builder() {
        }

        public Builder id(String id) {
            this.id = id;
            return this;
        }

        public Builder doctorId(Long doctorId) {
            this.doctorId = doctorId;
            return this;
        }

        public Builder patientId(Long patientId) {
            this.patientId = patientId;
            return this;
        }

        public Builder relation(Integer relation) {
            this.relation = relation;
            return this;
        }

        public Builder relationName(String relationName) {
            this.relationName = relationName;
            return this;
        }

        public Builder createAt(Date createAt) {
            this.createAt = createAt;
            return this;
        }

        public Builder createBy(String createBy) {
            this.createBy = createBy;
            return this;
        }

        public Builder changedAt(Date changedAt) {
            this.changedAt = changedAt;
            return this;
        }

        public Builder changeBy(String changeBy) {
            this.changeBy = changeBy;
            return this;
        }

        public MedicalRecordScreen build() {
            return new MedicalRecordScreen(this);
        }
    }
}
